package com.example.controller;

import com.example.feign.ProFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname ProviderController
 * @Description TODO
 * @Date 2022/3/27 8:38
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@RestController
@RequestMapping("provider")
public class ProviderController {

    @Value("${server.port}")
    private String port;

    @Autowired
    private ProFeignService proFeignService;

    @GetMapping("v1")
    public String v1Controller(){
        return "我是服务提供者:"+port;
    }

    @GetMapping("v2")
    public String v2Controller(){
        String val=proFeignService.v1String();
        return val+"《 === 》"+port;
    }
}
